import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/docPicture',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/docPicture/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/docPicture',
    method: 'put',
    data
  })
}

export function getPictureList(docId) {
  return request({
    url: 'api/docPicture/getPictureList/' + docId,
    method: 'get'
  })
}

export function getFirstPictureById(docId) {
  return request({
    url: 'api/docPicture/getFirstPictureById/' + docId,
    method: 'get'
  })
}

export function getNextPicture(docId, pageNum) {
  return request({
    url: 'api/docPicture/getNextPicture/' + docId + '/' + pageNum,
    method: 'get'
  })
}

export function getPrePicture(docId, pageNum) {
  return request({
    url: 'api/docPicture/getPrePicture/' + docId + '/' + pageNum,
    method: 'get'
  })
}

export function skip(docId, pageNum) {
  return request({
    url: 'api/docPicture/skip/' + docId + '/' + pageNum,
    method: 'get'
  })
}

export function totality(docId) {
  return request({
    url: 'api/docPicture/totality/' + docId,
    method: 'get'
  })
}

export function uploadImages(data) {
  return request({
    url: 'api/bookDocuments/upload',
    method: 'post',
    data
  })
}
export default {add, edit, del, getPictureList,uploadImages}
